﻿@model IEnumerable<SportsStore.Domain.Entities.Category>
@{
    ViewBag.Title = "CategoryIndex";
    Layout = "~/Views/Shared/_AdminLayout.cshtml";
}
<h2>
    CategoryIndex</h2>
<table>
    <tr>
        <th>
            ID
        </th>
        <th>
            Category Name
        </th>
        <th>
            Up
        </th>
        <th class="NumericCol">
            Category Ranking
        </th>
        <th>
            Down
        </th>
        <td>
            Description
        </td>
    </tr>
    @foreach (var cat in Model)
    {
        <tr>
            <td>
                @cat.Id
            </td>
            <td>
                @cat.Name
            </td>
            <td>
                
                @using (Html.BeginForm("UpCategory", "Admin", FormMethod.Post))
                {
                    @Html.Hidden("categoryId", cat.Id)
                    <input type="submit" value="UP" />
                }
            </td>
            <td>
                @cat.Ranking
            </td>
            <td>
                @using (Html.BeginForm("DownCategory", "Admin", FormMethod.Post))
                {
                    @Html.Hidden("categoryId", cat.Id)
                    <input type="submit" value="DOWN" />
                }
            </td>
            <td>
                @cat.Description
            </td>
        </tr>
    }
</table>
